home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
- (define (edit x)
- (let ((story nil)
- (not-done #t )
- (car-read nil)
- (times 0))
- (writeln "S.I.O.D. structure editor")
- (while not-done
- (print x)
- (newline)
- (display "EDIT > ")
- (set! car-read (read-char))
- (while (char=? car-read #\newline)
- (set! car-read (read-char)))
- (cond ((char=? car-read #\n ) (set! times (read))
- (when (pair? x)
- (set! story (cons x story))
- (set! x (cdr x))))
- ((char=? car-read #\p ) (set! times (read))
- (when (pair? story)
- (set! x (car story))
- (set! story (cdr story))))
- ((char=? car-read #\e ) (display "delete what?")
- (set! x (delete! (read) x)))
- ((char=? car-read #\f ) (display "find what?")
- (member (read) x))
- ((char=? car-read #\d ) (if (pair? (car x))
- (begin (set! story (cons x story))
- (set! x (car x)))
- (writeln "can't move down to sublist")))
- ((char=? car-read #\h ) (writeln "n<number> -- move on next pair")
- (writeln "p<number> -- move on previous pair")
- (writeln "d -- move on")
- (writeln "h -- help")
- (writeln "f -- find")
- (writeln "r -- reset to top level")
- (writeln "e -- delete")
- (writeln "q -- quit"))
- ((char=? car-read #\q ) (set! not-done #f))))))
-